package ssm.com.pojo;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

//与tb_door表映射
public class Door {
    private Integer doorId;
    private String doorName;
    private String doorTel;

    //按照指定的格式转成Date类型，方便插入和数据库交互，spring默认的类型是yyyy/MM/dd
    //spring默认的Date类型是yyyy/MM/dd,数据库默认的Date类型是yyyy-MM-dd
    //create_time字段
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    //modify_time字段
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date modifyTime;

    public Integer getDoorId() {
        return doorId;
    }

    public void setDoorId(Integer doorId) {
        this.doorId = doorId;
    }

    public String getDoorName() {
        return doorName;
    }

    public void setDoorName(String doorName) {
        this.doorName = doorName;
    }

    public String getDoorTel() {
        return doorTel;
    }

    public void setDoorTel(String doorTel) {
        this.doorTel = doorTel;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    @Override
    public String toString() {
        return "Door{" +
                "doorId=" + doorId +
                ", doorName='" + doorName + '\'' +
                ", doorTel='" + doorTel + '\'' +
                ", createTime=" + createTime +
                ", modifyTime=" + modifyTime +
                '}';
    }
}
